home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
EnigmA Amiga Run 1995 November
/
EnigmA AMIGA RUN 02 (1995)(G.R. Edizioni)(IT)[!][issue 1995-11][Skylink CD].iso
/
earcd
/
comm
/
dcddv24.lha
/
Do_PNET.rexx
< prev
next >
Wrap
OS/2 REXX Batch file
|
1995-09-05
|
13KB
|
498 lines
/*
Do_PNET.rexx Version 1.4 950803.0503
950728 - added X.OTHER gather-up area (for PGP stuff to start)
NOTE: +r = TEST i.e. no updates
when adding new newsgroup areas don't
forget the *** STUFF *** at the end....
950731 - killed DF as it does not seem to work anymore.. just hangs there..
950803 - put DF back as it works now (after I sent Nathan a message)
*/
address BAUD /* must have this here */
OPTIONS RESULTS
parse arg N_args
parse var N_args PW1 PW2 Xargs
/*
msg '************************'
msg 'Args = ' PW1 ' ' PW2 ' ' Xargs
msg '************************'
call delay(600)
*/
auto = 'X'
test = 'X'
waitlost = ' '
if exists('ram:PNET_TEST')~=0 then
test = 'y'
if exists('ram:AUTO')~=0 then
auto = 'y'
call LOGON /* for A and B */
/*
send '"set prompt = '][> '"\r'
*/
/*
** ---- below killed 950731 as it hangs up and just sits there....
** ---- below turned back on 950803. (Nathan got it fixed)
*/
if waitlost = 'n' then do
call AUTO_DF /* for C */
end
/*
** ---- above turned back on 950803. (Nathan got it fixed)
** ---- above killed 950731 as it hangs up and just sits there....
*/
if auto = 'y' then do
if waitlost = 'n' then
call AUTO_SOUP /* for D thru X */
end
if auto = 'y' then do
if waitlost = 'n' then
call CLEANUP
end
/* below gets you out of any process that has had problems */
if waitlost ~= 'n' then do
if exists('RAM:continue')~=0 then do
address command 'delete RAM:continue'
exit
end
end
return
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* *
* Functions / Subroutines *
* *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
LOGON:
address BAUD /* must have this here */
waitlost = ' '
do forever
nput='NO CARRIER,login:,Password:'
wait nput
NRC = RC
NRESULT = RESULT
if NRC > 0 then do /* waited 30 seconds & no nput items on serial port */
waitlost = 'y'
msg '****** LOGON - wait is LOST! ******'
Capture OFF
leave
end
/*
NOTE: Your Password on PNET MUST! be UPPER CASE or item below will fail.
The parse command is "parse upper" as the default!
*/
if NRESULT = 'Password:' then do
call delay(2)
waitlost = 'n'
send PW1 /* B */
send '\w\w\w\w\r'
end
if NRESULT = 'login:' then do
call delay(2)
send 'your.id' /* A */
send '\w\w\w\w\r'
end
/*
if NRESULT = '' then do
waitlost = 'y'
leave
end
*/
if NRESULT = 'NO CARRIER' then do /* if logon really gets */
waitlost = 'y' /* LOST */
leave /* this will get you OUT */
end
if waitlost ~= ' ' then
leave
end
return
AUTO_DF: /* Get Primenet Directory List */
OPTIONS RESULTS
address command
address BAUD /* must have this here */
waitlost = ' '
X_loop_count = 0
DONE_ONCE = 'n'
timeout 60 /* wait continues if no response within 1 minute */
do forever
nput='NO CARRIER,][>'
wait nput
NRC = RC
NRESULT = RESULT
if NRC > 0 then do /* waited 1 minute & no nput items on serial port */
waitlost = 'y'
msg '****** AUTO_DF - wait is LOST! ******'
Capture OFF
leave
end
if NRESULT = 'NO CARRIER' then do
waitlost = 'y'
leave
end
X_loop_count = X_loop_count + 1
if NRESULT = '][>' then do
if X_loop_count = 1 then
send 'df' /* C */
send '\r'
end
if NRESULT = '][>' then do
if X_loop_count = 2 then
waitlost = 'n'
end
if waitlost ~= ' ' then
leave
end
return
AUTO_SOUP: /* doing SOUP packets of NewsGroups */
OPTIONS RESULTS /* because these are clear text files */
address command /* when de-compressed. */
address BAUD /* must have this here */
waitlost = ' '
X_loop_count = 0
DONE_ONCE = 'n'
timeout 600 /* wait continues if no connectstring within 10 minutes */
do forever
nput='NO CARRIER,][>'
wait nput
NRC = RC
NRESULT = RESULT
if NRC > 0 then do /* waited 10 minutes & no nput items on serial port */
waitlost = 'y'
msg '****** AUTO_SOUP - wait is LOST! ******'
Capture OFF
leave
end
if NRESULT = 'NO CARRIER' then do
waitlost = 'y'
leave
end
if NRESULT = '][>' then do /* this section not used */
if X_loop_count = 0 then do /* much with multi group */
if exists('ram:.newsrc')~=0 then do /* sessions. */
if DONE_ONCE = 'n' then do
address command 'copy RAM:.newsrc RAM:-dl/.newsrc'
send '\w\w\w\w'
send 'rz -b -w 2048'
send '\r'
send '\w\w'
send '\au-.newsrc'
send '\w\w'
DONE_ONCE = 'y'
if exists('RAM:-dl/.newsrc')~=0 then do
address command 'delete RAM:-dl/.newsrc'
end
end
end
send '\w\w'
send '\r'
end
X_loop_count = X_loop_count + 1
/* get the MAIL */
if X_loop_count = 1 then do
send '\w\w'
/* send 'uqwk -n +L +m +r' +r = TEST i.e. no updates */
send 'uqwk -n +L +m' /* D */
send '\r'
end
if X_loop_count = 2 then do
send '\w\w'
send 'zip x.mail.zip *.MSG AREAS' /* E */
send '\r'
end
if X_loop_count = 3 then do
send '\w\w'
send 'rm *.MSG AREAS' /* F */
send '\r'
end
/* get AMIGA netnews */
if X_loop_count = 4 then do
send '\w\w'
send 'cp x.amiga.newsrc .newsrc' /* G */
send '\r'
end
if X_loop_count = 5 then do
send '\w\w'
/* send 'uqwk +x +n +L -m -B0 +r' +r = TEST i.e. no updates */
send 'uqwk +x +n +L -m -B0' /* H */
send '\r'
end
if X_loop_count = 6 then do
send '\w\w'
send 'zip x.amiga.zip *.MSG AREAS' /* I */
send '\r'
end
if X_loop_count = 7 then do
send '\w\w'
send 'cp .newsrc x.amiga.newsrc' /* J */
send '\r'
end
if X_loop_count = 8 then do
send '\w\w'
send 'rm *.MSG AREAS' /* K */
send '\r'
end
/* get PRIMENET netnews */
if X_loop_count = 9 then do
send '\w\w'
send 'cp x.pnet.newsrc .newsrc' /* L */
send '\r'
end
if X_loop_count = 10 then do
send '\w\w'
/* send 'uqwk +x +n +L -m -B0 +r' +r = TEST i.e. no updates */
send 'uqwk +x +n +L -m -B0' /* M */
send '\r'
end
if X_loop_count = 11 then do
send '\w\w'
send 'zip x.pnet.zip *.MSG AREAS' /* N */
send '\r'
end
if X_loop_count = 12 then do
send '\w\w'
send 'cp .newsrc x.pnet.newsrc' /* O */
send '\r'
end
if X_loop_count = 13 then do
send '\w\w'
send 'rm *.MSG AREAS' /* P */
send '\r'
end
/* get OTHER netnews */
if X_loop_count = 14 then do
send '\w\w'
send 'cp x.other.newsrc .newsrc' /* Q */
send '\r'
end
if X_loop_count = 15 then do
send '\w\w'
/* send 'uqwk +x +n +L -m -B0 +r' +r = TEST i.e. no updates */
send 'uqwk +x +n +L -m -B0' /* R */
send '\r'
end
if X_loop_count = 16 then do
send '\w\w'
send 'zip x.other.zip *.MSG AREAS' /* S */
send '\r'
end
if X_loop_count = 17 then do
send '\w\w'
send 'cp .newsrc x.other.newsrc' /* T */
send '\r'
end
if X_loop_count = 18 then do
send '\w\w'
send 'rm *.MSG AREAS' /* U */
send '\r'
end
/* download all x items */
if X_loop_count = 19 then do
send '\w\w'
send 'sz x.*' /* V */
send '\r'
end
/* kill all *.zip items */
if X_loop_count = 20 then do
send '\w\w'
send 'rm *.zip' /* W */
send '\r'
end
/* below keeps you inside Primenet if SIT_STAY exists
note: use number one greater than above.... */
if X_loop_count = 21 then do
if exists('ram:SIT_STAY')~=0 then do
waitlost = 'n'
leave
end
send '\w\w'
send 'x' /* X */
send '\r'
waitlost = 'n'
leave
end
call delay(1)
/* note: below uses the same count number as above */
if X_loop_count > 21 then do
waitlost = 'y'
msg '****** AUTO_SOUP - X_loop_count > 21 ******'
Capture OFF
leave
end
end /* comes from "if NRESULT = '][>' then do" way back there */
if waitlost ~= ' ' then
leave
end /* from WAIT way way back there */
return
CLEANUP:
OPTIONS RESULTS
address command
dateYYMMDD=right(date(sorted),6)
timea=translate(time(n),' ',':')
parse value timea with timeHH timeMM timeSS .
timeHHMMSS=timeHH||timeMM||timeSS
if exists('RAM:-dl/pnetinet.qwk')~=0 then do
/*
address command 'rename RAM:-dl/pnetinet.qwk RAM:-dl/pnetinet.qwk.'dateYYMMDD'.'timeHHMM
************************************************************************
can anyone tell me why the above line will not work, while the next
two will, please let me know. I'm stumped!
************************************************************************
*/
address command 'copy RAM:-dl/pnetinet.qwk RAM:-dl/pnetinet.qwk.'dateYYMMDD'.'timeHHMMSS
address command 'delete RAM:-dl/pnetinet.qwk'
end
if exists('RAM:-dl/.newsrc')~=0 then do
address command 'copy RAM:-dl/.newsrc RAM:-dl/pnetinet.tkn.'dateYYMMDD'.'timeHHMMSS
address command 'delete RAM:-dl/.newsrc'
end
if exists('RAM:.newsrc')~=0 then do
address command 'copy RAM:.newsrc RAM:UL_newsrc.'dateYYMMDD'.'timeHHMMSS
address command 'delete RAM:.newsrc'
end
/* ****************** MAIL STUFF ****************** */
if exists('RAM:-dl/x.mail.zip')~=0 then do
address command 'copy RAM:-dl/x.mail.zip RAM:-dl/x.mail.zip.'dateYYMMDD'.'timeHHMMSS
address command 'delete RAM:-dl/x.mail.zip'
end
/* ****************** AMIGA STUFF ****************** */
if exists('RAM:-dl/x.amiga.zip')~=0 then do
address command 'copy RAM:-dl/x.amiga.zip RAM:-dl/x.amiga.zip.'dateYYMMDD'.'timeHHMMSS
address command 'delete RAM:-dl/x.amiga.zip'
end
if exists('RAM:-dl/x.amiga.newsrc')~=0 then do
address command 'copy RAM:-dl/x.amiga.newsrc RAM:-dl/x.amiga.newsrc.'dateYYMMDD'.'timeHHMMSS
address command 'delete RAM:-dl/x.amiga.newsrc'
end
/* ****************** PRIMENET STUFF ****************** */
if exists('RAM:-dl/x.pnet.zip')~=0 then do
address command 'copy RAM:-dl/x.pnet.zip RAM:-dl/x.pnet.zip.'dateYYMMDD'.'timeHHMMSS
address command 'delete RAM:-dl/x.pnet.zip'
end
if exists('RAM:-dl/x.pnet.newsrc')~=0 then do
address command 'copy RAM:-dl/x.pnet.newsrc RAM:-dl/x.pnet.newsrc.'dateYYMMDD'.'timeHHMMSS
address command 'delete RAM:-dl/x.pnet.newsrc'
end
/* ****************** OTHER STUFF ****************** */
if exists('RAM:-dl/x.other.zip')~=0 then do
address command 'copy RAM:-dl/x.other.zip RAM:-dl/x.other.zip.'dateYYMMDD'.'timeHHMMSS
address command 'delete RAM:-dl/x.other.zip'
end
if exists('RAM:-dl/x.other.newsrc')~=0 then do
address command 'copy RAM:-dl/x.other.newsrc RAM:-dl/x.other.newsrc.'dateYYMMDD'.'timeHHMMSS
address command 'delete RAM:-dl/x.other.newsrc'
end
/* ****************** END STUFF ****************** */
if exists('RAM:SIT_STAY')~=0 then
address command 'delete RAM:SIT_STAY'
return